// components/my-component/my-component.js
Component({

  /**
   * 组件的属性列表
   * props
   */
  properties: {
    name: String,
    age: {
      type: Number,
      value: 100
    },
    hobby: Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    myAddress: '广东省深圳市'
  },

  lifetimes: {
    created() {
      console.log('---created---')
    },
    attached() {
      console.log('---attached---')
    },
    ready() {
      console.log('---ready---',this)
    },
    detached() {
      console.log('---detached---')
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    sendValueToParent() {
      // console.log('---sendValueToParent---')
      this.triggerEvent('myevent',{food: '兰州拉面',price: 14})
    }
  }
})